using System;
using System.Collections;
using System.Collections.Generic;


namespace NanoERP.Model
{
    /// <summary>
    /// 部门人员信息
    /// </summary>
    [Serializable]
    public sealed class Userinfo
    {
        #region Private Members

        // Variabili di stato
        private bool _isChanged;

        // Primary Key(s) 
        private long _id;

        // Properties 
        private string _userno;
        private string _username;
        private string _userpym;
        private string _gender;
        private string _pwd;
        private DateTime? _birthday;
        private DateTime? _farmday;
        private string _jobrole;
        private int? _deptid;
        private string _homephone;
        private string _nationstate;
        private string _address;
        private string _postcode;
        private string _abode;
        private string _mobilephone;
        private string _otherphone;
        private string _cardno;
        private DateTime? _comeindate;
        private string _culture;
        private string _marriage;
        private string _finishschool;
        private short? _isvalid;
        private short? _canlogin;
        private string _logintype;
        private string _usbkeyno;
        private int? _tag;
        private string _exfield1;
        private string _exfield2;
        private string _exfield3;
        private string _exfield4;
        private DateTime? _createdate;
        private long? _createuserid;
        private string _note;
        private string _email;

        #endregion

        #region Default ( Empty ) Class Constructor

        /// <summary>
        /// default constructor
        /// </summary>
        public Userinfo()
        {
            _id = 0;
            _userno = null;
            _username = null;
            _userpym = null;
            _gender = null;
            _pwd = null;
            _birthday = null;
            _farmday = null;
            _jobrole = null;
            _deptid = null;
            _homephone = null;
            _nationstate = null;
            _address = null;
            _postcode = null;
            _abode = null;
            _mobilephone = null;
            _otherphone = null;
            _cardno = null;
            _comeindate = DateTime.Now;
            _culture = null;
            _marriage = null;
            _finishschool = null;
            _isvalid = 0;
            _canlogin = 0;
            _logintype = null;
            _usbkeyno = null;
            _tag = null;
            _exfield1 = null;
            _exfield2 = null;
            _exfield3 = null;
            _exfield4 = null;
            _createdate = DateTime.Now;
            _createuserid = null;
            _note = null;
            _email = null;
        }

        #endregion // End of Default ( Empty ) Class Constructor

        #region Full Constructor

        /// <summary>
        /// full constructor
        /// </summary>
        public Userinfo(long id, string userno, string username, string userpym, string gender, string pwd, DateTime? birthday, DateTime? farmday, string jobrole, int? deptid, string homephone, string nationstate, string address, string postcode, string abode, string mobilephone, string otherphone, string cardno, DateTime? comeindate, string culture, string marriage, string finishschool, short? isvalid, short? canlogin, string logintype, string usbkeyno, int? tag, string exfield1, string exfield2, string exfield3, string exfield4, DateTime? createdate, long? createuserid, string note, string email)
        {
            _id = id;
            _userno = userno;
            _username = username;
            _userpym = userpym;
            _gender = gender;
            _pwd = pwd;
            _birthday = birthday;
            _farmday = farmday;
            _jobrole = jobrole;
            _deptid = deptid;
            _homephone = homephone;
            _nationstate = nationstate;
            _address = address;
            _postcode = postcode;
            _abode = abode;
            _mobilephone = mobilephone;
            _otherphone = otherphone;
            _cardno = cardno;
            _comeindate = comeindate;
            _culture = culture;
            _marriage = marriage;
            _finishschool = finishschool;
            _isvalid = isvalid;
            _canlogin = canlogin;
            _logintype = logintype;
            _usbkeyno = usbkeyno;
            _tag = tag;
            _exfield1 = exfield1;
            _exfield2 = exfield2;
            _exfield3 = exfield3;
            _exfield4 = exfield4;
            _createdate = createdate;
            _createuserid = createuserid;
            _note = note;
            _email = email;
        }

        #endregion // End Full Constructor

        #region Public Properties

        /// <summary>
        /// 主键
        /// </summary>		
        public long Id
        {
            get { return _id; }
            set { _isChanged |= (_id != value); _id = value; }
        }

        /// <summary>
        /// 人员编号
        /// </summary>		
        public string Userno
        {
            get { return _userno; }
            set
            {
                if (value != null)
                    if (value.Length > 50)
                        throw new ArgumentOutOfRangeException("Invalid value for Userno", value, value.ToString());

                _isChanged |= (_userno != value); _userno = value;
            }
        }

        /// <summary>
        /// 姓名
        /// </summary>		
        public string Username
        {
            get { return _username; }
            set
            {
                if (value != null)
                    if (value.Length > 50)
                        throw new ArgumentOutOfRangeException("Invalid value for Username", value, value.ToString());

                _isChanged |= (_username != value); _username = value;
            }
        }

        /// <summary>
        /// 拼音码
        /// </summary>		
        public string Userpym
        {
            get { return _userpym; }
            set
            {
                if (value != null)
                    if (value.Length > 50)
                        throw new ArgumentOutOfRangeException("Invalid value for Userpym", value, value.ToString());

                _isChanged |= (_userpym != value); _userpym = value;
            }
        }

        /// <summary>
        /// 性别
        /// </summary>		
        public string Gender
        {
            get { return _gender; }
            set
            {
                if (value != null)
                    if (value.Length > 2)
                        throw new ArgumentOutOfRangeException("Invalid value for Gender", value, value.ToString());

                _isChanged |= (_gender != value); _gender = value;
            }
        }

        /// <summary>
        /// 密码
        /// </summary>		
        public string Pwd
        {
            get { return _pwd; }
            set
            {
                if (value != null)
                    if (value.Length > 255)
                        throw new ArgumentOutOfRangeException("Invalid value for Pwd", value, value.ToString());

                _isChanged |= (_pwd != value); _pwd = value;
            }
        }

        /// <summary>
        /// 生日
        /// </summary>		
        public DateTime? Birthday
        {
            get { return _birthday; }
            set { _isChanged |= (_birthday != value); _birthday = value; }
        }

        /// <summary>
        /// 农历生日
        /// </summary>		
        public DateTime? Farmday
        {
            get { return _farmday; }
            set { _isChanged |= (_farmday != value); _farmday = value; }
        }

        /// <summary>
        /// SELECT  * FROM [dbo].[REFCODE] WHERE DOMAIN_NO='职务'
        /// </summary>		
        public string Jobrole
        {
            get { return _jobrole; }
            set
            {
                if (value != null)
                    if (value.Length > 255)
                        throw new ArgumentOutOfRangeException("Invalid value for Jobrole", value, value.ToString());

                _isChanged |= (_jobrole != value); _jobrole = value;
            }
        }

        /// <summary>
        /// 所属部门
        /// </summary>		
        public int? Deptid
        {
            get { return _deptid; }
            set { _isChanged |= (_deptid != value); _deptid = value; }
        }

        /// <summary>
        /// 家庭电话
        /// </summary>		
        public string Homephone
        {
            get { return _homephone; }
            set
            {
                if (value != null)
                    if (value.Length > 50)
                        throw new ArgumentOutOfRangeException("Invalid value for Homephone", value, value.ToString());

                _isChanged |= (_homephone != value); _homephone = value;
            }
        }

        /// <summary>
        /// 籍贯
        /// </summary>		
        public string Nationstate
        {
            get { return _nationstate; }
            set
            {
                if (value != null)
                    if (value.Length > 255)
                        throw new ArgumentOutOfRangeException("Invalid value for Nationstate", value, value.ToString());

                _isChanged |= (_nationstate != value); _nationstate = value;
            }
        }

        /// <summary>
        /// 家庭地址
        /// </summary>		
        public string Address
        {
            get { return _address; }
            set
            {
                if (value != null)
                    if (value.Length > 255)
                        throw new ArgumentOutOfRangeException("Invalid value for Address", value, value.ToString());

                _isChanged |= (_address != value); _address = value;
            }
        }

        /// <summary>
        /// 邮件编码
        /// </summary>		
        public string Postcode
        {
            get { return _postcode; }
            set
            {
                if (value != null)
                    if (value.Length > 6)
                        throw new ArgumentOutOfRangeException("Invalid value for Postcode", value, value.ToString());

                _isChanged |= (_postcode != value); _postcode = value;
            }
        }

        /// <summary>
        /// 现住址
        /// </summary>		
        public string Abode
        {
            get { return _abode; }
            set
            {
                if (value != null)
                    if (value.Length > 200)
                        throw new ArgumentOutOfRangeException("Invalid value for Abode", value, value.ToString());

                _isChanged |= (_abode != value); _abode = value;
            }
        }

        /// <summary>
        /// 手机
        /// </summary>		
        public string Mobilephone
        {
            get { return _mobilephone; }
            set
            {
                if (value != null)
                    if (value.Length > 50)
                        throw new ArgumentOutOfRangeException("Invalid value for Mobilephone", value, value.ToString());

                _isChanged |= (_mobilephone != value); _mobilephone = value;
            }
        }

        /// <summary>
        /// 其它手机
        /// </summary>		
        public string Otherphone
        {
            get { return _otherphone; }
            set
            {
                if (value != null)
                    if (value.Length > 50)
                        throw new ArgumentOutOfRangeException("Invalid value for Otherphone", value, value.ToString());

                _isChanged |= (_otherphone != value); _otherphone = value;
            }
        }

        /// <summary>
        /// 身份证号
        /// </summary>		
        public string Cardno
        {
            get { return _cardno; }
            set
            {
                if (value != null)
                    if (value.Length > 18)
                        throw new ArgumentOutOfRangeException("Invalid value for Cardno", value, value.ToString());

                _isChanged |= (_cardno != value); _cardno = value;
            }
        }

        /// <summary>
        /// 入职日期
        /// </summary>		
        public DateTime? Comeindate
        {
            get { return _comeindate; }
            set { _isChanged |= (_comeindate != value); _comeindate = value; }
        }

        /// <summary>
        /// 文化程度
        /// </summary>		
        public string Culture
        {
            get { return _culture; }
            set
            {
                if (value != null)
                    if (value.Length > 255)
                        throw new ArgumentOutOfRangeException("Invalid value for Culture", value, value.ToString());

                _isChanged |= (_culture != value); _culture = value;
            }
        }

        /// <summary>
        ///  婚姻状况
        /// </summary>		
        public string Marriage
        {
            get { return _marriage; }
            set
            {
                if (value != null)
                    if (value.Length > 255)
                        throw new ArgumentOutOfRangeException("Invalid value for Marriage", value, value.ToString());

                _isChanged |= (_marriage != value); _marriage = value;
            }
        }

        /// <summary>
        /// 毕业院校
        /// </summary>		
        public string Finishschool
        {
            get { return _finishschool; }
            set
            {
                if (value != null)
                    if (value.Length > 300)
                        throw new ArgumentOutOfRangeException("Invalid value for Finishschool", value, value.ToString());

                _isChanged |= (_finishschool != value); _finishschool = value;
            }
        }

        /// <summary>
        /// 是否离职 1是  0否
        /// </summary>		
        public short? Isvalid
        {
            get { return _isvalid; }
            set { _isChanged |= (_isvalid != value); _isvalid = value; }
        }

        /// <summary>
        /// 是否允许登录系统
        /// </summary>		
        public short? Canlogin
        {
            get { return _canlogin; }
            set { _isChanged |= (_canlogin != value); _canlogin = value; }
        }

        /// <summary>
        /// 登录方式（1.密码登录 2. USER_KEY登录 3.密码+USER_KEY登录）
        /// </summary>		
        public string Logintype
        {
            get { return _logintype; }
            set
            {
                if (value != null)
                    if (value.Length > 20)
                        throw new ArgumentOutOfRangeException("Invalid value for Logintype", value, value.ToString());

                _isChanged |= (_logintype != value); _logintype = value;
            }
        }

        /// <summary>
        /// 
        /// </summary>		
        public string Usbkeyno
        {
            get { return _usbkeyno; }
            set
            {
                if (value != null)
                    if (value.Length > 255)
                        throw new ArgumentOutOfRangeException("Invalid value for Usbkeyno", value, value.ToString());

                _isChanged |= (_usbkeyno != value); _usbkeyno = value;
            }
        }

        /// <summary>
        /// 
        /// </summary>		
        public int? Tag
        {
            get { return _tag; }
            set { _isChanged |= (_tag != value); _tag = value; }
        }

        /// <summary>
        /// 
        /// </summary>		
        public string Exfield1
        {
            get { return _exfield1; }
            set
            {
                if (value != null)
                    if (value.Length > 100)
                        throw new ArgumentOutOfRangeException("Invalid value for Exfield1", value, value.ToString());

                _isChanged |= (_exfield1 != value); _exfield1 = value;
            }
        }

        /// <summary>
        /// 
        /// </summary>		
        public string Exfield2
        {
            get { return _exfield2; }
            set
            {
                if (value != null)
                    if (value.Length > 100)
                        throw new ArgumentOutOfRangeException("Invalid value for Exfield2", value, value.ToString());

                _isChanged |= (_exfield2 != value); _exfield2 = value;
            }
        }

        /// <summary>
        /// 
        /// </summary>		
        public string Exfield3
        {
            get { return _exfield3; }
            set
            {
                if (value != null)
                    if (value.Length > 100)
                        throw new ArgumentOutOfRangeException("Invalid value for Exfield3", value, value.ToString());

                _isChanged |= (_exfield3 != value); _exfield3 = value;
            }
        }

        /// <summary>
        /// 
        /// </summary>		
        public string Exfield4
        {
            get { return _exfield4; }
            set
            {
                if (value != null)
                    if (value.Length > 100)
                        throw new ArgumentOutOfRangeException("Invalid value for Exfield4", value, value.ToString());

                _isChanged |= (_exfield4 != value); _exfield4 = value;
            }
        }

        /// <summary>
        /// 创建日期
        /// </summary>		
        public DateTime? Createdate
        {
            get { return _createdate; }
            set { _isChanged |= (_createdate != value); _createdate = value; }
        }

        /// <summary>
        /// 创建人
        /// </summary>		
        public long? Createuserid
        {
            get { return _createuserid; }
            set { _isChanged |= (_createuserid != value); _createuserid = value; }
        }

        /// <summary>
        /// 备注
        /// </summary>		
        public string Note
        {
            get { return _note; }
            set
            {
                if (value != null)
                    if (value.Length > 600)
                        throw new ArgumentOutOfRangeException("Invalid value for Note", value, value.ToString());

                _isChanged |= (_note != value); _note = value;
            }
        }

        /// <summary>
        /// 
        /// </summary>		
        public string Email
        {
            get { return _email; }
            set
            {
                if (value != null)
                    if (value.Length > 30)
                        throw new ArgumentOutOfRangeException("Invalid value for Email", value, value.ToString());

                _isChanged |= (_email != value); _email = value;
            }
        }

        #endregion

    }
}